Crate destream_json[−][src]
Library for decoding and encoding JSON streams.
Example:
let expected = ("one".to_string(), 2.0, vec![3, 4]); let stream = destream_json::encode(&expected).unwrap(); let actual = block_on(destream_json::try_decode((), stream)).unwrap(); assert_eq!(expected, actual);
Deviations from the JSON spec:
destream_json
will not error out if asked to decode or encode a non-string key in a JSON object (i.e., it supports a superset of the official JSON spec). This may cause issues when using another JSON library to decode a stream encoded bydestream_json
. This can be mitigated by simply not using non-string object keys, or adding an explicit check at encoding time.
Re-exports
pub use de::decode; |
pub use de::read_from; |
pub use de::try_decode; |
pub use en::encode; |
pub use en::encode_map; |
pub use en::encode_seq; |
Modules
de | Decode a JSON stream to a Rust data structure. |
en | Encode a Rust data structure into JSON data. |